# 自发自处页面封装
from app_ui.lib.base.app_keywords import AppKeyWords
from app_ui.lib.common.common_function import *
from appium.webdriver.common.mobileby import MobileBy
from appium import webdriver
from app_ui.lib.base.app_page_object.login_page import LonginPage


class DealMyself(AppKeyWords):
    # 新增自发自处事件
    def create_event(self):
        data = get_data_by_yaml(get_path() + r'\data\app_element_data\deal_myself.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    # 设置请求参数
    desired_caps = open_app_params('app_sit_82')
    # 打开首页
    driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
    login = LonginPage(driver)
    # 打开app
    login.login('kobekq1', 'kobe8888')
    case = DealMyself(driver)
    case.create_event()
    driver.quit()
